<?php if (!defined('THINK_PATH')) exit();?>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>EHS中国信息管理系统</title>
    <link rel="stylesheet" type="text/css" href="__ROOT__/Public/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="__ROOT__/Public/themes/icon.css" />
    <link href="__ROOT__/Public/Css/ehs-admin.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="__ROOT__/Public/Js/jquery-1.5.0.min.js"></script>
    <script type="text/javascript" src="__ROOT__/Public/Js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="__ROOT__/Public/Js/core.js"></script>
    <script type="text/javascript" src="__TMPL__/js/index.js"></script>
    <script type="text/javascript" >
      var dev = "<?php echo ($dev); ?>";
      function setTab1(m,n){
        var menu=document.getElementById("tab"+m).getElementsByTagName("li");   //获取ID为tab+m标签下的li标签
        var showdiv=document.getElementById("tablist"+m).getElementsByTagName("div");   //获取ID为tablist+m标签下的div标签
        for(var i=0;i<menu.length;i++)
        {
          menu[i].className=i==n?"now":"";   //如果i=n;那么menu[i].classname为now
          showdiv[i].style.display=i==n?"block":"none";   //如果如果i=n;那么showdiv[i].style.display为block"
        }
      }
      $(function() {
        $("#category h2").click(function(){
          $("#category h2 span").removeClass('down');
          $(this).next('ul').show('fast').siblings('ul').hide();
          $(this).find('span').addClass('down');
          $("#category h2").next().attr("display",1);
        })
      });
      
      var showPos = {left:695,top:157};
      if (dev == 1) showPos = {left:695,top:277};

      $(function(){
        $('#mm').menu();
        $('#collect').click(function(){
          $('#mm').menu('show',showPos);
        });
        /*      $(document).bind('contextmenu',function(e){
          $('#mm').menu('show', {
            left: e.pageX,
            top: e.pageY
          });
          return false;
        }); */
      });

      $(function(){
        $('#tt1').tree();
      });

    </script>
  </head>
  <body class="layout-container" oncontextmenu="return false">
  <?php if($dev == 1): ?><div region="north" border="false" style="height:113px;">
      <div id="header">
        <div id="help">
          <ul>
            <li><a href="javascript:alert('正在开发中')" title="文件" class="icon-document">文件</a></li>
            <li><a href="javascript:alert('正在开发中')" title="查看" class="icon-check">查看</a></li>
            <li><a href="javascript:alert('正在开发中')" title="帮助" class="icon-help">帮助</a></li>
          </ul>
        </div>

        <div id="logo">
          <h1><a href="__URL__"><img src="__ROOT__/Public/Images/logo.png" alt="" title="" /></a></h1>
        </div>

        <div id="main-nav">
          <ul>
            <li><a href="__URL__/index/nid/1" title="" class="icon-news">新闻</a></li>
            <li><a href="__URL__/index/nid/2" title="" class="icon-law">法规</a></li>
            <li><a href="__URL__/index/nid/3" title="" class="icon-data">资料</a></li>
            <li><a href="javascript:alert('正在开发中')" title="" class="icon-bbs">社区</a></li>
            <li><a href="javascript:alert('正在开发中')" title="" class="icon-train">培训</a></li>
            <li><a href="javascript:alert('正在开发中')" title="" class="icon-ehs">企业EHS解决方案</a></li>
            <li><a href="javascript:alert('正在开发中')" title="" class="icon-d-ehs">企业文件夹</a></li>
            <li><a href="__URL__/setting/uid/<?php echo ($uid); ?>" title="" class="icon-news">用户配置</a></li>
            <li><a href="__ROOT__/public.php/law" title="" class="icon-news">法规搜索页面</a></li>
          </ul>
        </div>
      </div>
    </div><?php endif; ?>

  <div region="west" split="true" style="width:300px; border-left:10px solid #0C7DD4; border-bottom:10px solid #0C7DD4;">
    <div id="sidebar" >
      <div class="tab" >
        <div class="tab-title" id="tab2">
          <ul>
            <li class="now" onClick="setTab1(2,0)"><a href="#" title=""><?php echo ($channelName); ?>频道</a></li>
            <li onClick="setTab1(2,1)"><a href="#" title=""><?php echo ($channelName); ?>收藏夹</a></li>
            <li onClick="setTab1(2,2)"><a href="#" title="">我要发布</a></li>
          </ul>
        </div>
        <div class="tab-cont" id="tablist2">

          <!-------------------频道列表------------------>
          <div class="tablist block" id="category" >
            <?php if(is_array($info)): $i = 0; $__LIST__ = $info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><h2 <?php if($i == 5): ?>style="display:none"<?php endif; ?>><span></span><a href="javascript:void(0)"><?php echo ($channel[$i]); ?></a></h2>
              <ul style="display:none" display="0">
                <?php if(is_array($vo)): $j = 0; $__LIST__ = $vo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$l): ++$j;$mod = ($j % 2 )?><li><a href="javascript:void(0)" onClick="clickChannel('<?php echo ($l["id"]); ?>','<?php echo ($i); ?>','<?php echo ($nid); ?>')"><?php echo ($l["title"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
              </ul><?php endforeach; endif; else: echo "" ;endif; ?>
          </div>
          <!-----------------/End 频道列表----------------------------->


          <!------------------------收藏夹功能------------------------------>
          <div id="divFavList" class="tablist" style="display:none; padding:10px;">
            <ul id="tt1">
              <li>
                <div class="tree-node"><span class="tree-folder tree-folder-open icon-star4"></span><span class="tree-title" oncontextmenu="rightclickMenu(event,this,0,1,1)">我的收藏夹</span></div>
              </li>
              <?php if(is_array($favorite)): $i = 0; $__LIST__ = $favorite;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><li>
                  <span>
                    <a href="javascript:void(0)" onDblClick="dbclickChangeName(this)" oncontextmenu="rightclickMenu(event,this,'<?php echo ($vo["id"]); ?>',1,2)"><?php echo ($vo["title"]); ?></a>
                    <input type="text" value="<?php echo ($vo["title"]); ?>" style="display:none" onBlur="changeInputValue(this,'<?php echo ($vo["id"]); ?>',1)"/>
                  </span>
                  <ul>
                    <?php if(is_array($vo["downLine"])): $i = 0; $__LIST__ = $vo["downLine"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vd): ++$i;$mod = ($i % 2 )?><li>
                        <span>
                          <a href="javascript:void(0)" onDblClick="dbclickChangeName(this)" oncontextmenu="rightclickMenu(event,this,'<?php echo ($vd["id"]); ?>',1,3)"><?php echo ($vd["title"]); ?></a>
                          <input type="text" value="<?php echo ($vd["title"]); ?>" style="display:none" onBlur="changeInputValue(this,'<?php echo ($vd["id"]); ?>',1)"/>
                        </span>
                        <ul>
                          <?php if(is_array($vd["downLine"])): $i = 0; $__LIST__ = $vd["downLine"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vl): ++$i;$mod = ($i % 2 )?><li>
                              <span>
                                <a href="javascript:void(0)" onDblClick="dbclickChangeName(this)" oncontextmenu="rightclickMenu(event,this,'<?php echo ($vl["id"]); ?>',1,4)"><?php echo ($vl["title"]); ?></a>
                                <input type="text" value="<?php echo ($vl["title"]); ?>" style="display:none" onBlur="changeInputValue(this,'<?php echo ($vl["id"]); ?>',1)"/>
                              </span>
                            <?php if(count(vl._list) > 0): ?><ul>
                                <?php if(is_array($vl["_list"])): $i = 0; $__LIST__ = $vl["_list"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vll): ++$i;$mod = ($i % 2 )?><li>
                                    <span>
                                      <a href="javascript:void(0)" onClick="clickFavoriteTitle('<?php echo ($vll["type"]); ?>','<?php echo ($vll["tid"]); ?>')" onDblClick="dbclickChangeName(this)" oncontextmenu="rightclickMenu(event,this,'<?php echo ($vll["id"]); ?>',2,9)"><?php echo ($vll["title"]); ?></a>
                                      <input type="text" value="<?php echo ($vll["title"]); ?>" style="display:none" onBlur="changeInputValue(this,'<?php echo ($vll["id"]); ?>',2)"/>
                                    </span>
                                  </li><?php endforeach; endif; else: echo "" ;endif; ?>
                              </ul><?php endif; ?>
                            </li><?php endforeach; endif; else: echo "" ;endif; ?>
                        </ul>
                      </li>
                      <?php if(count(vd._list) > 0): ?><?php if(is_array($vd["_list"])): $i = 0; $__LIST__ = $vd["_list"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vdl): ++$i;$mod = ($i % 2 )?><li>
                            <span>
                              <a href="javascript:void(0)" onClick="clickFavoriteTitle('<?php echo ($vdl["type"]); ?>','<?php echo ($vdl["tid"]); ?>')" onDblClick="dbclickChangeName(this)" oncontextmenu="rightclickMenu(event,this,'<?php echo ($vdl["id"]); ?>',2,9)"><?php echo ($vdl["title"]); ?></a>
                              <input type="text" value="<?php echo ($vdl["title"]); ?>" style="display:none" onBlur="changeInputValue(this,'<?php echo ($vdl["id"]); ?>',2)"/>
                            </span>
                          </li><?php endforeach; endif; else: echo "" ;endif; ?><?php endif; ?><?php endforeach; endif; else: echo "" ;endif; ?>
                  </ul>
                </li>

                <?php if(count(vo._list) > 0): ?><?php if(is_array($vo["_list"])): $i = 0; $__LIST__ = $vo["_list"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vol): ++$i;$mod = ($i % 2 )?><li>
                      <span>
                        <a href="javascript:void(0)" onClick="clickFavoriteTitle('<?php echo ($vol["type"]); ?>','<?php echo ($vol["tid"]); ?>')" onDblClick="dbclickChangeName(this)" oncontextmenu="rightclickMenu(event,this,'<?php echo ($vol["id"]); ?>',2,9)"><?php echo ($vol["title"]); ?></a>
                        <input type="text" value="<?php echo ($vol["title"]); ?>" style="display:none" onBlur="changeInputValue(this,'<?php echo ($vol["id"]); ?>',2)"/>
                      </span>
                    </li><?php endforeach; endif; else: echo "" ;endif; ?><?php endif; ?><?php endforeach; endif; else: echo "" ;endif; ?>
            </ul>
          </div>


          <div class="tablist"  style="display:none;">tablist3</div>
        </div>
      </div>
    </div><!-- /End Sidebar -->
  </div>


  <div region="center" style="border-right:10px solid #0C7DD4; border-bottom:10px solid #0C7DD4;">
    <div id="main-cont">
      <!------------------------------------TOP信息---------------------------------->
      <div id="list-news-index" region="north" split="true" style="height:100px; overflow:auto;">
        <table class="grid">
          <thead>
            <tr>
              <td width="700px">标题</td>
              <td width="200px">作者</td>
              <td>发布时间</td>
            </tr>
          </thead><tbody style="display:none"><tr><td></td></tr></tbody>
        </table>
        <div id="divLoadingList" style="display: none"><img src="__ROOT__/Public/images/loading.gif"/></div>
        <div id="divList">
          <table class="grid">
            <tbody>
            <?php if(is_array($newsList)): $i = 0; $__LIST__ = $newsList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$list): ++$i;$mod = ($i % 2 )?><tr>
                <td width="700px"><a href="javascript:void(0)" onClick="clickTitle('<?php echo ($list["id"]); ?>')"><?php echo ($list["title"]); ?></a></td>
                <td width="200px"><?php echo ($list["username"]); ?></td>
                <td><?php echo ($list["updatetime"]); ?></td>
              </tr><?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
          </table>
        </div>
      </div>
      <!----------------------------------- /End TOP信息 --------------------------------------->



      <div id="reader-warp-index">
        <div id="reader-toolbar">
          <ul>
            <li><a href="javascript:alert('正在开发中')" title="新建" class="icon-new">新建</a></li>
            <li><a href="javascript:alert('正在开发中')" title="保存" class="icon-save">保存</a></li>
            <li><a href="javascript:alert('正在开发中')" title="上一步" class="icon-pre">上一步</a></li>
            <li><a href="javascript:alert('正在开发中')" title="下一步" class="icon-next">下一步</a></li>
            <li><a href="javascript:alert('正在开发中')" title="刷新" class="icon-refresh">刷新</a></li>
            <li><a href="javascript:alert('正在开发中')" title="关闭" class="icon-close">关闭</a></li>
            <li><a href="javascript:alert('正在开发中')" title="上一条" class="icon-pre-info">上一条</a></li>
            <li><a href="javascript:alert('正在开发中')" title="下一条" class="icon-next-info">下一条</a></li>
            <li><a href="javascript:void(0)" title="收藏" class="icon-collect" id="collect">收藏</a></li>
            <li><a href="javascript:alert('正在开发中')" title="链接" class="icon-link">链接</a></li>
            <li><a href="javascript:alert('正在开发中')" title="设置" class="icon-set">设置</a></li>
            <li><a href="javascript:alert('正在开发中')" title="搜索" class="icon-sreach">搜索</a></li>
          </ul>
        </div>
        <div id="reader-cont" style="height:560px; overflow:auto;">
          <div id="message" >
            <ul>
              <li><a href="#" title="">精彩推荐</a></li>
              <li><a href="#" title="">功能演示</a></li>
              <li><a href="#" title="">帮助</a></li>
              <li><a href="#" title="">留言</a></li>
            </ul>
          </div>
          <div id="divLoadingArticle" style="display: none"><img src="__ROOT__/Public/images/loading.gif"/></div>
          <!----------------------------------文章内容-------------------------------------->
          <div id="article">
            <!--   <?php if($nid != 3): ?><div class="article-title">
                   <h2><?php echo ($newsContent["title"]); ?></h2>
                   <div class="article-info">
                     <span>来源：中国报 </span>
                     <span>发布：能源</span>
                     <span>日期：<?php echo ($newsContent["updatetime"]); ?></span>
                   </div>
                 </div><?php endif; ?>-->
            <div class="article-cont">
              <?php if($nid == 3): ?><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="900" height="600">
                  <param name="movie" value="http://www.ehs.cn/admin_swf/<?php echo ($newsContent['content']); ?>.swf" />
                  <param name="quality" value="high" />
                  <embed src="http://www.ehs.cn/admin_swf/<?php echo ($newsContent['content']); ?>.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="600" ></embed>
                </object>
                <?php else: ?>
                <?php echo ($newsContent["content"]); ?><?php endif; ?>

            </div>
          </div>
          <!------------------------------/END 文章内容---------------------------------------------->
        </div>
      </div>
    </div><!-- /End Main-cont -->
  </div>

  <div id="mm" style="width:180px;">
    <!-- <div onclick="javascript:alert('添加到收藏夹')" icon="icon-save-add">添加到收藏夹</div>
     <div class="menu-sep"></div>  -->
    <?php if(is_array($favorite)): $i = 0; $__LIST__ = $favorite;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$fa1): ++$i;$mod = ($i % 2 )?><div onclick="clickFavFlie('<?php echo ($fa1["id"]); ?>')">
        <span class="icon-document2" ><?php echo ($fa1["title"]); ?></span>
        <div style="width:180px;">
          <?php if(is_array($fa1["downLine"])): $i = 0; $__LIST__ = $fa1["downLine"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$fa2): ++$i;$mod = ($i % 2 )?><div class="icon-document2" onclick="clickFavFlie('<?php echo ($fa2["id"]); ?>')">
              <span ><?php echo ($fa2["title"]); ?></span>
              <div style="width:180px;">
                <?php if(is_array($fa2["downLine"])): $i = 0; $__LIST__ = $fa2["downLine"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$fa3): ++$i;$mod = ($i % 2 )?><div icon="icon-star3" onclick="clickFavFlie('<?php echo ($fa3["id"]); ?>')"><?php echo ($fa3["title"]); ?></div><?php endforeach; endif; else: echo "" ;endif; ?>
                <div icon="icon-save2" onclick="clickNewFavFile('<?php echo ($fa2["id"]); ?>',3)">新建文件夹</div>
              </div>
            </div><?php endforeach; endif; else: echo "" ;endif; ?>
          <div icon="icon-save2" onclick="clickNewFavFile('<?php echo ($fa1["id"]); ?>',2)">新建文件夹</div>
        </div>
      </div><?php endforeach; endif; else: echo "" ;endif; ?>
    <div icon="icon-save2" onclick="clickNewFavFile(0,1)">新建文件夹</div>
    <div class="menu-sep"></div>
  </div>

  <div id="divRightClick" style="width:100px">
    <div id="divNewFile">新建文件夹</div>
    <div id="divRepeat">重名题</div>
    <div id="divDelete">删除</div>
  </div>
  <a id="lnkHiddent" href="javascript:void(0)" style="display:none"></a>

  <script>
    var uid = "<?php echo ($uid); ?>";//用户id
    var nid = "<?php echo ($nid); ?>";//1-新闻，2-法规，3-资料
    var url = "__URL__";//默认首页
    //发现TP一个很白痴的问题，cinfo={id:"{$cid}",title:"<?php echo ($ctitle); ?>"}竟然"<?php echo ($cid); ?>"和"<?php echo ($ctitle); ?>"是字符串
    var cid = "<?php echo ($cid); ?>", ctitle = "<?php echo ($ctitle); ?>",cinfo = {id:cid,title:ctitle};
    var r = {};//用来存储删除文件和文件夹信息的变量
    //setTimeout(function(){alert("{$aa}")},1000)
    if ("<?php echo ($issetting); ?>" == 0) {
      var rt = confirm("您还没有对频道列表进行设置，是否现在去设置");
      if (rt){
        window.location.href = url+"/setting/uid/<?php echo ($uid); ?>";
      }
    }

    //$(document).ready(function() {});
  </script>
</body>
</html>